package com.joysuch.wwyt.workflow.enums;

/**
 * @Author WorkFlowDataSourceEnum
 * @Date 2021/4/16 14:00
 */
public enum WorkFlowDisplayFormEnum {
   THREE_FOUR_LINE ("three_four_line", "四行三格");
    String code;
    String name;

    private WorkFlowDisplayFormEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public boolean is(String code) {
        return this.code.equals(code);
    }

    public static WorkFlowDisplayFormEnum findByCode(String code) {
        if (code == null) {
            return null;
        }
        for (WorkFlowDisplayFormEnum m : WorkFlowDisplayFormEnum.values()) {
            if (m.code.equals(code)) {
                return m;
            }
        }
        return null;
    }

    public static String findNameByCode(String code) {
        WorkFlowDisplayFormEnum m = findByCode(code);
        return m == null ? null : m.getName();
    }
}
